﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CommonTagTime.ModelObject;
using CommonTagTime;
using CommonTagTime.Business;
public partial class NewsDetail : SitePage
{
    public TipNews objNew = new TipNews();
    public TipNewsCollection lstOther = new TipNewsCollection();
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!Page.IsPostBack)
            LoadData();

    }

    private void LoadData()
    {
        string title = string.Empty;
        int id = clsQueryString.GetInt("id");
        if (id > 0)
        {
            busTipNews objBus = new busTipNews();
            objNew = objBus.GetByID(id);
            if (objNew != null && objNew.PageTitle != string.Empty)
                title = objNew.PageTitle;
            else title = objNew.Title;
            //get list Other     
            TipNews objCon = new TipNews();
            objCon.CurrentPage = 1;
            objCon.OrderBy = busTipNews.SORTORDER;
            objCon.OrderDirection = "ASC";
            objCon.PageSize = int.MaxValue;
            objCon.Condition = " t.IsActive=1 and t.[Type]='" + (int)enmTipNewsType.NewEvent + "' and t.TipNewsID<>" + id;
            lstOther = objBus.List(objCon);
            this.SetMetaData(string.Format(Resources.Resource.TITLE, Server.HtmlEncode(title)), objNew.MetaDescription, objNew.MetaKeywords);
        }
    }
    
}